import * as antd from 'antd';
import {useMyReducer} from './UseMyReducer';
import UseReducerChild from './UseReducerChild.jsx'
import UseReducerSimple from './UseReducerSimple.jsx'
import LoginUseReducer from './LoginUseReducer.jsx'
export default function(){

    const [state, dispatch] = useMyReducer();
    return (
        <div>
            <h2>1.简单的例子：</h2><br/>
            <UseReducerSimple></UseReducerSimple>
            <hr/>
            <h2>2.登录使用useReducer例子：</h2><br/>
            <LoginUseReducer></LoginUseReducer>
            <hr/>
            <h2>3.自定义hooks例子：</h2><br/>
            state:
            {
                JSON.stringify(state)
            }
        <UseReducerChild ck={ ()=> {dispatch({type: 'addTest'})}}>child</UseReducerChild>
        </div>
    )
}